package com.blb.community.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blb.community.pojo.Building;
import com.blb.community.pojo.Community;
import com.blb.community.pojo.Unit;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigInteger;
import java.util.List;

public interface CommunityMapper extends BaseMapper<Community> {

    @Select("select * from zy_community")
    IPage<Community> selectPage(IPage<Community> page);

    Community updateCommunity(Community community);

    Community saveCommunity(Community community);

    List<Community> SelectAreaByName(@Param("communityName") String communityName, @Param("selectLikeCommunityName") String selectLikeCommunityName, @Param("selectLikeCommunityCode") String selectLikeCommunityCode, @Param("current") Long current, @Param("size") Long size, @Param("communityId") BigInteger communityId);

    List<Community> SelectCommunity(String communityName);

    Community SelectCommunityById(BigInteger communityId);

    List<Building> selectBuildingByCommunityId(BigInteger communityId);
    List<Unit> selectUnitByBuildingId(BigInteger buildingId);
}